home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: LaTeX Document
(document/latex).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
1%
| dexvert
| Corel 10 Texture (image/corel10Texture)
| ext
| Unsupported |
1%
| dexvert
| Croteam texture file (image/croteamTextureFile)
| ext
| Unsupported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| LaTeX document text
| default
| |
99%
| file
| C source, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/281 LaTeX (Subdocument)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 73 65 63 74 69 6f 6e | 7b 44 65 76 65 6c 6f 70 |\section|{Develop|
|00000010| 65 72 27 73 20 47 75 69 | 64 65 7d 0a 0a 54 68 65 |er's Gui|de}..The|
|00000020| 20 61 70 70 65 6e 64 69 | 78 20 69 73 20 70 72 69 | appendi|x is pri|
|00000030| 6d 61 72 69 6c 79 20 63 | 6f 6e 63 65 72 6e 65 64 |marily c|oncerned|
|00000040| 20 77 69 74 68 20 69 73 | 73 75 65 73 20 72 65 6c | with is|sues rel|
|00000050| 61 74 65 64 20 74 6f 20 | 61 64 64 69 6e 67 0a 65 |ated to |adding.e|
|00000060| 78 74 65 6e 73 69 6f 6e | 73 20 74 6f 20 5c 62 69 |xtension|s to \bi|
|00000070| 74 20 70 72 6f 67 72 61 | 6d 2c 20 73 75 63 68 20 |t progra|m, such |
|00000080| 61 73 20 61 64 64 69 6e | 67 20 6e 65 77 20 66 6f |as addin|g new fo|
|00000090| 72 6d 61 74 73 0a 61 6e | 64 2f 6f 72 20 61 64 64 |rmats.an|d/or add|
|000000a0| 69 6e 67 20 6e 65 77 20 | 65 64 69 74 69 6e 67 20 |ing new |editing |
|000000b0| 63 61 70 61 62 69 6c 69 | 74 69 65 73 2e 20 49 6e |capabili|ties. In|
|000000c0| 20 74 68 65 20 66 69 72 | 73 74 20 61 20 66 65 77 | the fir|st a few|
|000000d0| 20 73 75 62 73 65 63 74 | 69 6f 6e 73 2c 0a 6d 6f | subsect|ions,.mo|
|000000e0| 72 65 20 64 65 74 61 69 | 6c 65 64 20 69 6e 74 65 |re detai|led inte|
|000000f0| 72 6e 61 6c 20 73 74 72 | 75 63 74 75 72 65 20 6f |rnal str|ucture o|
|00000100| 66 20 74 68 65 20 5c 62 | 69 74 20 70 72 6f 67 72 |f the \b|it progr|
|00000110| 61 6d 20 69 73 20 67 69 | 76 65 6e 20 61 6e 64 0a |am is gi|ven and.|
|00000120| 6c 61 74 65 72 20 73 75 | 62 73 65 63 74 69 6f 6e |later su|bsection|
|00000130| 73 20 67 69 76 65 20 73 | 70 65 63 69 66 69 63 20 |s give s|pecific |
|00000140| 69 6e 73 74 72 75 63 74 | 69 6f 6e 73 20 6f 6e 20 |instruct|ions on |
|00000150| 61 64 64 69 6e 67 20 6e | 65 77 20 66 6f 72 6d 61 |adding n|ew forma|
|00000160| 74 2e 0a 49 74 20 69 73 | 20 72 65 63 6f 6d 6d 65 |t..It is| recomme|
|00000170| 6e 64 65 64 20 74 68 61 | 74 20 79 6f 75 20 70 6c |nded tha|t you pl|
|00000180| 61 79 20 77 69 74 68 20 | 74 68 65 20 70 72 6f 67 |ay with |the prog|
|00000190| 72 61 6d 20 62 65 66 6f | 72 65 20 79 6f 75 0a 61 |ram befo|re you.a|
|000001a0| 74 74 65 6d 70 74 20 74 | 6f 20 61 64 64 20 6e 65 |ttempt t|o add ne|
|000001b0| 77 20 63 61 70 61 62 69 | 6c 69 74 69 65 73 20 74 |w capabi|lities t|
|000001c0| 6f 20 69 74 2e 0a 5c 73 | 75 62 73 65 63 74 69 6f |o it..\s|ubsectio|
|000001d0| 6e 7b 49 6d 61 67 65 20 | 54 79 70 65 73 7d 0a 5c |n{Image |Types}.\|
|000001e0| 42 69 74 20 77 6f 72 6b | 73 20 69 6e 74 65 72 6e |Bit work|s intern|
|000001f0| 61 6c 6c 79 20 69 6e 20 | 52 47 42 20 73 70 61 63 |ally in |RGB spac|
|00000200| 65 2c 20 77 68 69 63 68 | 20 69 73 20 73 70 6c 69 |e, which| is spli|
|00000210| 74 20 69 6e 74 6f 0a 70 | 61 63 6b 65 64 20 70 69 |t into.p|acked pi|
|00000220| 78 65 6c 20 72 65 70 72 | 65 73 65 6e 74 61 74 69 |xel repr|esentati|
|00000230| 6f 6e 20 61 6e 64 20 63 | 6f 6c 6f 72 20 69 6e 64 |on and c|olor ind|
|00000240| 65 78 20 28 43 49 29 20 | 72 65 70 72 65 73 65 6e |ex (CI) |represen|
|00000250| 74 61 74 69 6f 6e 0a 64 | 65 70 65 6e 64 69 6e 67 |tation.d|epending|
|00000260| 20 6f 6e 20 74 68 65 20 | 69 6e 70 75 74 20 69 6d | on the |input im|
|00000270| 61 67 65 2e 20 54 79 70 | 65 20 63 6f 6e 76 65 72 |age. Typ|e conver|
|00000280| 73 69 6f 6e 73 20 62 65 | 74 77 65 65 6e 0a 70 61 |sions be|tween.pa|
|00000290| 63 6b 65 64 20 70 69 78 | 65 6c 20 61 6e 64 20 43 |cked pix|el and C|
|000002a0| 49 20 61 72 65 20 74 79 | 70 69 63 61 6c 6c 79 20 |I are ty|pically |
|000002b0| 74 72 61 6e 73 70 61 72 | 61 6e 74 20 61 6e 64 20 |transpar|ant and |
|000002c0| 6e 65 65 64 20 6e 6f 0a | 75 73 65 72 20 69 6e 74 |need no.|user int|
|000002d0| 65 72 61 74 69 6f 6e 2e | 20 47 72 61 79 73 63 61 |eration.| Graysca|
|000002e0| 6c 65 20 69 6d 61 67 65 | 73 20 63 61 6e 20 65 78 |le image|s can ex|
|000002f0| 69 73 74 20 65 69 74 68 | 65 72 20 69 6e 0a 70 61 |ist eith|er in.pa|
|00000300| 63 6b 65 64 20 70 69 78 | 65 6c 20 72 65 70 72 65 |cked pix|el repre|
|00000310| 73 65 6e 74 61 74 69 6f | 6e 20 6f 72 20 43 49 20 |sentatio|n or CI |
|00000320| 72 65 70 72 65 73 65 6e | 74 61 74 69 6f 6e 2e 20 |represen|tation. |
|00000330| 42 6c 61 63 6b 20 5c 26 | 20 57 68 69 74 65 0a 69 |Black \&| White.i|
|00000340| 6d 61 67 65 73 2c 20 68 | 6f 77 65 76 65 72 2c 20 |mages, h|owever, |
|00000350| 6f 6e 6c 79 20 65 78 69 | 73 74 20 69 6e 20 43 49 |only exi|st in CI|
|00000360| 20 66 6f 72 6d 61 74 2e | 0a 0a 52 47 42 20 70 72 | format.|..RGB pr|
|00000370| 69 6d 61 72 69 65 73 20 | 61 72 65 20 63 75 72 72 |imaries |are curr|
|00000380| 65 6e 74 6c 79 20 72 65 | 70 72 65 73 65 6e 74 65 |ently re|presente|
|00000390| 64 20 62 79 20 5c 76 65 | 72 62 2b 75 6e 73 69 67 |d by \ve|rb+unsig|
|000003a0| 6e 65 64 20 63 68 61 72 | 2b 0a 61 6e 64 20 63 6f |ned char|+.and co|
|000003b0| 6e 73 65 71 75 65 6e 74 | 6c 79 20 6f 6e 6c 79 20 |nsequent|ly only |
|000003c0| 38 62 69 74 73 20 6f 66 | 20 72 65 73 6f 6c 75 74 |8bits of| resolut|
|000003d0| 69 6f 6e 2e 20 48 6f 77 | 65 76 65 72 2c 20 64 69 |ion. How|ever, di|
|000003e0| 72 65 63 74 20 75 73 65 | 0a 6f 66 20 5c 76 65 72 |rect use|.of \ver|
|000003f0| 62 2b 75 6e 73 69 67 6e | 65 64 20 63 68 61 72 2b |b+unsign|ed char+|
|00000400| 20 69 73 20 73 74 72 6f | 6e 67 6c 79 20 64 69 73 | is stro|ngly dis|
|00000410| 63 6f 75 72 61 67 65 64 | 2c 20 69 6e 73 74 65 61 |couraged|, instea|
|00000420| 64 2c 0a 75 73 65 20 74 | 68 65 20 6e 65 77 20 74 |d,.use t|he new t|
|00000430| 79 70 65 20 5c 76 65 72 | 62 2b 70 63 5f 74 2b 20 |ype \ver|b+pc_t+ |
|00000440| 66 6f 72 20 70 72 69 6d | 61 72 79 20 63 6f 6c 6f |for prim|ary colo|
|00000450| 72 20 76 61 72 61 69 62 | 6c 65 73 0a 61 6e 64 20 |r varaib|les.and |
|00000460| 72 65 73 6f 6c 75 74 69 | 6f 6e 20 6f 66 20 77 68 |resoluti|on of wh|
|00000470| 69 63 68 20 63 61 6e 20 | 62 65 20 64 65 74 65 72 |ich can |be deter|
|00000480| 6d 69 6e 65 64 20 66 6f | 72 6d 20 7b 5c 74 74 20 |mined fo|rm {\tt |
|00000490| 50 43 42 49 54 53 7d 0a | 61 6e 64 20 7b 5c 74 74 |PCBITS}.|and {\tt|
|000004a0| 20 50 43 4d 41 58 7d 2e | 0a 0a 5c 73 75 62 73 75 | PCMAX}.|..\subsu|
|000004b0| 62 73 65 63 74 69 6f 6e | 7b 54 72 75 65 43 6f 6c |bsection|{TrueCol|
|000004c0| 6f 72 7d 0a 54 72 75 65 | 20 63 6f 6c 6f 72 20 69 |or}.True| color i|
|000004d0| 6d 61 67 65 73 20 61 72 | 65 20 63 75 72 72 65 6e |mages ar|e curren|
|000004e0| 74 6c 79 20 68 61 6e 64 | 6c 65 64 20 62 79 20 70 |tly hand|led by p|
|000004f0| 61 63 6b 69 6e 67 20 34 | 62 79 74 65 73 0a 69 6e |acking 4|bytes.in|
|00000500| 20 52 47 42 41 20 77 69 | 74 68 20 41 20 62 65 69 | RGBA wi|th A bei|
|00000510| 6e 67 20 74 68 65 20 61 | 6c 70 68 61 20 63 68 61 |ng the a|lpha cha|
|00000520| 6e 6e 65 6c 20 28 75 6e | 75 73 65 64 29 20 77 69 |nnel (un|used) wi|
|00000530| 74 68 0a 72 65 64 20 62 | 65 69 6e 67 20 74 68 65 |th.red b|eing the|
|00000540| 20 6c 6f 77 65 73 74 20 | 62 79 74 65 2e 20 41 67 | lowest |byte. Ag|
|00000550| 61 69 6e 2c 20 74 68 65 | 72 65 20 69 73 20 6e 6f |ain, the|re is no|
|00000560| 20 6e 65 65 64 20 74 6f | 0a 6b 6e 6f 77 20 65 78 | need to|.know ex|
|00000570| 61 63 74 6c 79 20 68 6f | 77 20 61 20 70 61 63 6b |actly ho|w a pack|
|00000580| 65 64 20 70 69 78 65 6c | 20 69 73 20 72 65 70 72 |ed pixel| is repr|
|00000590| 65 73 65 6e 74 65 64 2c | 20 75 73 65 0a 74 68 65 |esented,| use.the|
|000005a0| 20 66 6f 6c 6c 6f 77 69 | 6e 67 20 74 77 6f 20 72 | followi|ng two r|
|000005b0| 6f 75 74 69 6e 65 73 20 | 28 6d 61 63 72 6f 73 29 |outines |(macros)|
|000005c0| 20 74 6f 20 6f 70 65 72 | 61 74 65 20 6f 6e 20 61 | to oper|ate on a|
|000005d0| 0a 70 61 72 74 69 63 75 | 6c 61 72 20 74 72 75 65 |.particu|lar true|
|000005e0| 63 6f 6c 6f 72 20 70 69 | 78 65 6c 20 28 5c 76 65 |color pi|xel (\ve|
|000005f0| 72 62 2b 72 67 62 61 5f | 74 2b 20 69 73 20 74 68 |rb+rgba_|t+ is th|
|00000600| 65 20 70 61 63 6b 65 64 | 20 70 69 78 65 6c 20 74 |e packed| pixel t|
|00000610| 79 70 65 29 3a 0a 5c 62 | 65 67 69 6e 7b 76 65 72 |ype):.\b|egin{ver|
|00000620| 62 61 74 69 6d 7d 0a 65 | 78 74 65 72 6e 20 72 67 |batim}.e|xtern rg|
|00000630| 62 61 5f 74 20 50 61 63 | 6b 28 69 6e 74 20 72 65 |ba_t Pac|k(int re|
|00000640| 64 2c 20 69 6e 74 20 67 | 72 65 65 6e 2c 20 69 6e |d, int g|reen, in|
|00000650| 74 20 62 6c 75 65 29 3b | 0a 65 78 74 65 72 6e 20 |t blue);|.extern |
|00000660| 76 6f 69 64 20 55 6e 70 | 61 63 6b 28 72 67 62 61 |void Unp|ack(rgba|
|00000670| 5f 74 20 70 61 63 6b 65 | 64 2c 20 69 6e 74 20 2a |_t packe|d, int *|
|00000680| 72 65 64 2c 20 69 6e 74 | 20 2a 67 72 65 65 6e 2c |red, int| *green,|
|00000690| 20 69 6e 74 20 2a 62 6c | 75 65 29 3b 0a 5c 65 6e | int *bl|ue);.\en|
|000006a0| 64 7b 76 65 72 62 61 74 | 69 6d 7d 0a 0a 47 72 61 |d{verbat|im}..Gra|
|000006b0| 79 20 69 6d 61 67 65 73 | 20 69 6e 20 70 61 63 6b |y images| in pack|
|000006c0| 65 64 20 70 69 78 65 6c | 20 66 6f 72 6d 61 74 20 |ed pixel| format |
|000006d0| 68 61 76 65 20 61 20 74 | 79 70 65 20 6f 66 20 5c |have a t|ype of \|
|000006e0| 76 65 72 62 2b 67 72 61 | 79 5f 74 2b 2c 0a 77 68 |verb+gra|y_t+,.wh|
|000006f0| 69 63 68 20 69 73 20 74 | 68 65 20 73 61 6d 65 20 |ich is t|he same |
|00000700| 61 73 20 5c 76 65 72 62 | 2b 72 67 62 61 5f 74 2b |as \verb|+rgba_t+|
|00000710| 20 69 6e 20 74 68 65 20 | 73 65 6e 73 65 20 6f 66 | in the |sense of|
|00000720| 20 70 61 63 6b 69 6e 67 | 0a 61 6e 64 20 75 6e 70 | packing|.and unp|
|00000730| 61 63 6b 69 6e 67 2e 0a | 0a 5c 73 75 62 73 75 62 |acking..|.\subsub|
|00000740| 73 65 63 74 69 6f 6e 7b | 43 6f 6c 6f 72 6d 61 70 |section{|Colormap|
|00000750| 70 65 64 20 69 6d 61 67 | 65 73 7d 0a 43 49 20 62 |ped imag|es}.CI b|
|00000760| 61 73 65 64 20 69 6d 61 | 67 65 20 68 61 73 20 74 |ased ima|ge has t|
|00000770| 68 65 20 74 79 70 65 20 | 6f 66 20 5c 76 65 72 62 |he type |of \verb|
|00000780| 2b 63 69 5f 74 2b 20 68 | 61 76 69 6e 67 0a 7b 5c |+ci_t+ h|aving.{\|
|00000790| 74 74 20 43 4d 41 50 42 | 49 54 53 7d 20 61 6e 64 |tt CMAPB|ITS} and|
|000007a0| 20 69 74 73 20 6d 61 78 | 69 6d 75 6d 20 76 61 6c | its max|imum val|
|000007b0| 75 65 20 69 73 20 7b 5c | 74 74 20 4d 41 58 43 4d |ue is {\|tt MAXCM|
|000007c0| 4c 7d 2e 0a 54 68 65 20 | 63 6f 6c 6f 72 6d 61 70 |L}..The |colormap|
|000007d0| 20 69 74 73 65 6c 66 20 | 68 61 73 20 74 68 65 20 | itself |has the |
|000007e0| 74 79 70 65 20 6f 66 20 | 5c 76 65 72 62 2b 43 5f |type of |\verb+C_|
|000007f0| 4d 41 50 2b 2c 20 77 68 | 69 63 68 0a 69 73 20 61 |MAP+, wh|ich.is a|
|00000800| 20 73 74 72 75 63 74 75 | 72 65 20 63 6f 6e 74 61 | structu|re conta|
|00000810| 69 6e 69 6e 67 20 73 6f | 6d 65 20 63 6f 6e 74 72 |ining so|me contr|
|00000820| 6f 6c 20 70 61 72 61 6d | 65 74 65 72 73 0a 61 6e |ol param|eters.an|
|00000830| 64 20 74 68 65 20 70 72 | 69 6d 61 72 79 20 63 6f |d the pr|imary co|
|00000840| 6c 6f 72 20 61 72 72 61 | 79 73 20 7b 5c 76 65 72 |lor arra|ys {\ver|
|00000850| 62 2b 70 63 5f 74 20 63 | 74 5b 33 5d 5b 4d 41 58 |b+pc_t c|t[3][MAX|
|00000860| 43 4d 4c 5d 2b 7d 2c 0a | 77 68 65 72 65 20 69 6e |CML]+},.|where in|
|00000870| 64 65 78 20 30 20 69 73 | 20 72 65 64 2c 20 31 20 |dex 0 is| red, 1 |
|00000880| 69 73 20 67 72 65 65 6e | 20 61 6e 64 20 32 20 69 |is green| and 2 i|
|00000890| 73 20 62 6c 75 65 2e 0a | 0a 47 72 61 79 73 63 61 |s blue..|.Graysca|
|000008a0| 6c 65 20 69 6d 61 67 65 | 73 20 63 61 6e 20 62 65 |le image|s can be|
|000008b0| 20 72 65 70 72 65 73 65 | 6e 65 64 20 62 79 20 63 | represe|ned by c|
|000008c0| 6f 6c 6f 72 6d 61 70 20 | 62 61 73 65 64 20 69 6d |olormap |based im|
|000008d0| 61 67 65 0a 61 6e 64 20 | 69 6e 20 74 68 61 74 20 |age.and |in that |
|000008e0| 63 61 73 65 2c 20 74 68 | 65 20 69 6d 61 67 65 20 |case, th|e image |
|000008f0| 74 79 70 65 20 73 68 6f | 75 6c 64 20 62 65 20 5c |type sho|uld be \|
|00000900| 76 65 72 62 2b 6d 61 70 | 67 5f 74 2b 2e 0a 42 5c |verb+map|g_t+..B\|
|00000910| 26 57 20 69 6d 61 67 65 | 73 20 61 72 65 20 6a 75 |&W image|s are ju|
|00000920| 73 74 20 73 65 70 63 69 | 61 6c 20 63 61 73 65 73 |st sepci|al cases|
|00000930| 20 6f 66 20 67 72 61 79 | 73 63 61 6c 65 20 69 6d | of gray|scale im|
|00000940| 61 67 65 73 0a 77 69 74 | 68 20 32 20 65 6e 74 72 |ages.wit|h 2 entr|
|00000950| 69 65 73 20 69 6e 20 74 | 68 65 20 63 6f 6c 6f 72 |ies in t|he color|
|00000960| 6d 61 70 2e 0a 0a 5c 73 | 75 62 73 75 62 73 65 63 |map...\s|ubsubsec|
|00000970| 74 69 6f 6e 7b 53 75 6d | 6d 61 72 79 20 6f 66 20 |tion{Sum|mary of |
|00000980| 69 6d 61 67 65 20 74 79 | 70 65 73 7d 0a 46 6f 6c |image ty|pes}.Fol|
|00000990| 6c 6f 77 69 6e 67 20 74 | 79 70 65 73 20 61 72 65 |lowing t|ypes are|
|000009a0| 20 64 65 66 69 6e 65 64 | 20 69 6e 20 5c 76 65 72 | defined| in \ver|
|000009b0| 62 2b 75 74 79 70 65 2e | 68 2b 20 61 6e 64 20 63 |b+utype.|h+ and c|
|000009c0| 61 6e 20 62 65 20 75 73 | 65 64 0a 61 6e 79 77 68 |an be us|ed.anywh|
|000009d0| 65 72 65 20 69 66 20 74 | 68 65 69 72 20 64 65 66 |ere if t|heir def|
|000009e0| 69 6e 61 74 69 6f 6e 73 | 20 61 72 65 20 69 6e 63 |inations| are inc|
|000009f0| 6c 75 64 65 64 3a 0a 0a | 5c 62 65 67 69 6e 7b 76 |luded:..|\begin{v|
|00000a00| 65 72 62 61 74 69 6d 7d | 0a 74 79 70 65 64 65 66 |erbatim}|.typedef|
|00000a10| 20 65 6e 75 6d 20 7b 0a | 20 20 20 20 54 5f 52 47 | enum {.| T_RG|
|00000a20| 42 41 2c 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |BA, | |
|00000a30| 20 20 20 20 20 20 20 20 | 2f 2a 20 70 61 63 6b 65 | |/* packe|
|00000a40| 64 20 52 47 42 41 20 76 | 61 6c 75 65 73 20 20 20 |d RGBA v|alues |
|00000a50| 20 20 20 20 20 20 20 20 | 20 2a 2f 0a 20 20 20 20 | | */. |
|00000a60| 54 5f 47 52 41 59 2c 20 | 20 20 20 20 20 20 20 20 |T_GRAY, | |
|00000a70| 20 20 20 20 20 20 20 20 | 20 20 20 20 2f 2a 20 70 | | /* p|
|00000a80| 61 63 6b 65 64 20 52 47 | 42 41 20 67 72 61 79 73 |acked RG|BA grays|
|00000a90| 63 61 6c 65 20 20 20 20 | 20 20 20 20 20 2a 2f 0a |cale | */.|
|00000aa0| 20 20 20 20 54 5f 43 4d | 41 50 2c 20 20 20 20 20 | T_CM|AP, |
|00000ab0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000ac0| 2f 2a 20 6d 61 70 70 65 | 64 20 69 6d 61 67 65 73 |/* mappe|d images|
|00000ad0| 20 68 61 76 69 6e 67 20 | 63 69 5f 74 20 74 79 70 | having |ci_t typ|
|00000ae0| 65 20 2a 2f 0a 20 20 20 | 20 54 5f 47 4d 41 50 2c |e */. | T_GMAP,|
|00000af0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000b00| 20 20 20 20 20 2f 2a 20 | 67 72 61 79 20 73 63 61 | /* |gray sca|
|00000b10| 6c 65 20 6d 61 70 70 65 | 64 20 69 6d 61 67 65 73 |le mappe|d images|
|00000b20| 20 20 20 20 20 20 20 2a | 2f 0a 20 20 20 20 54 5f | *|/. T_|
|00000b30| 42 57 2c 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |BW, | |
|00000b40| 20 20 20 20 20 20 20 20 | 20 20 2f 2a 20 42 6c 61 | | /* Bla|
|00000b50| 63 6b 20 26 20 57 68 69 | 74 65 20 69 6d 61 67 65 |ck & Whi|te image|
|00000b60| 73 20 20 20 20 20 20 20 | 20 20 20 2a 2f 0a 20 20 |s | */. |
|00000b70| 20 20 54 5f 52 47 42 2c | 20 20 20 20 20 20 20 20 | T_RGB,| |
|00000b80| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2a | | /*|
|00000b90| 20 49 6e 74 65 72 6e 61 | 6c 20 74 79 70 65 20 20 | Interna|l type |
|00000ba0| 28 75 6e 75 73 65 64 29 | 20 20 20 20 20 20 20 2a |(unused)| *|
|00000bb0| 2f 0a 20 20 20 20 54 5f | 46 4c 45 58 20 20 20 20 |/. T_|FLEX |
|00000bc0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000bd0| 20 20 2f 2a 20 66 6c 65 | 78 69 62 6c 65 28 75 6e | /* fle|xible(un|
|00000be0| 6b 6e 6f 77 6e 29 20 74 | 79 70 65 73 20 20 20 20 |known) t|ypes |
|00000bf0| 20 20 20 2a 2f 0a 7d 20 | 49 4d 47 5f 54 59 50 45 | */.} |IMG_TYPE|
|00000c00| 3b 0a 5c 65 6e 64 7b 76 | 65 72 62 61 74 69 6d 7d |;.\end{v|erbatim}|
|00000c10| 0a 0a 41 6c 6c 20 74 79 | 70 65 73 20 68 61 76 65 |..All ty|pes have|
|00000c20| 20 74 68 65 20 6f 62 76 | 69 6f 75 73 20 6d 65 61 | the obv|ious mea|
|00000c30| 6e 69 6e 67 20 65 78 63 | 65 70 74 20 5c 76 65 72 |ning exc|ept \ver|
|00000c40| 62 2b 54 5f 46 4c 45 58 | 2b 2c 0a 77 68 69 63 68 |b+T_FLEX|+,.which|
|00000c50| 20 69 6e 64 69 63 61 74 | 65 73 20 61 6e 20 75 6e | indicat|es an un|
|00000c60| 6b 6e 6f 77 6e 20 74 79 | 70 65 2c 20 6f 72 2c 20 |known ty|pe, or, |
|00000c70| 69 6e 20 6f 74 68 65 72 | 20 77 6f 72 64 73 2c 0a |in other| words,.|
|00000c80| 61 6e 79 20 74 79 70 65 | 20 69 73 20 6f 6b 2e 20 |any type| is ok. |
|00000c90| 41 20 67 6c 6f 62 61 6c | 20 66 75 6e 63 74 69 6f |A global| functio|
|00000ca0| 6e 0a 69 73 20 70 72 6f | 76 69 64 65 64 20 74 6f |n.is pro|vided to|
|00000cb0| 20 63 6f 6e 76 65 72 74 | 20 62 65 74 77 65 65 6e | convert| between|
|00000cc0| 20 61 6c 6c 20 74 79 70 | 65 73 3a 0a 0a 5c 76 65 | all typ|es:..\ve|
|00000cd0| 72 62 2b 65 78 74 65 72 | 6e 20 69 6e 74 20 69 6d |rb+exter|n int im|
|00000ce0| 61 67 65 5f 63 6f 6e 76 | 65 72 74 5f 74 79 70 65 |age_conv|ert_type|
|00000cf0| 28 49 50 54 52 20 69 6d | 2c 20 49 4d 47 5f 54 59 |(IPTR im|, IMG_TY|
|00000d00| 50 45 20 6e 65 77 74 79 | 70 65 29 3b 2b 0a 0a 5c |PE newty|pe);+..\|
|00000d10| 6e 6f 69 6e 64 65 6e 74 | 0a 54 68 69 73 20 66 75 |noindent|.This fu|
|00000d20| 6e 63 74 69 6f 6e 20 77 | 69 6c 6c 20 63 6f 6e 76 |nction w|ill conv|
|00000d30| 65 72 74 20 74 68 65 20 | 69 6d 61 67 65 2c 20 70 |ert the |image, p|
|00000d40| 6f 69 6e 74 65 64 20 74 | 6f 20 62 79 20 5c 76 65 |ointed t|o by \ve|
|00000d50| 72 62 2b 69 6d 2b 2c 0a | 74 6f 20 74 68 65 20 72 |rb+im+,.|to the r|
|00000d60| 65 71 75 65 73 74 64 20 | 74 79 70 65 20 5c 76 65 |equestd |type \ve|
|00000d70| 72 62 2b 6e 65 77 74 79 | 70 65 2b 2e 20 49 66 20 |rb+newty|pe+. If |
|00000d80| 63 6f 6e 76 65 72 73 69 | 6f 6e 20 69 73 20 73 75 |conversi|on is su|
|00000d90| 63 73 73 65 66 75 6c 2c | 0a 61 20 70 6f 73 69 74 |csseful,|.a posit|
|00000da0| 69 76 65 20 76 61 6c 75 | 65 20 6f 72 20 7a 65 72 |ive valu|e or zer|
|00000db0| 6f 20 77 69 6c 6c 20 62 | 65 20 72 65 74 75 6e 65 |o will b|e retune|
|00000dc0| 64 20 61 6e 64 20 6f 74 | 68 65 72 77 69 73 65 0a |d and ot|herwise.|
|00000dd0| 61 20 6e 65 67 61 74 69 | 76 65 20 76 61 6c 75 65 |a negati|ve value|
|00000de0| 20 77 69 6c 6c 20 62 65 | 20 72 65 74 75 72 6e 65 | will be| returne|
|00000df0| 64 2e 20 41 6c 6c 20 65 | 72 72 6f 72 73 20 6f 72 |d. All e|rrors or|
|00000e00| 20 72 65 61 73 6f 6e 73 | 0a 66 6f 72 20 66 61 69 | reasons|.for fai|
|00000e10| 6c 75 72 65 20 61 72 65 | 20 68 61 6e 64 6c 65 64 |lure are| handled|
|00000e20| 20 62 79 20 74 68 65 20 | 63 6f 6e 76 65 72 73 69 | by the |conversi|
|00000e30| 6f 6e 20 72 6f 75 74 69 | 6e 65 20 61 6e 64 20 74 |on routi|ne and t|
|00000e40| 68 65 72 65 20 69 73 0a | 6e 6f 20 6e 65 65 64 20 |here is.|no need |
|00000e50| 74 6f 20 63 61 6c 6c 20 | 65 72 72 6f 72 20 68 61 |to call |error ha|
|00000e60| 6e 64 6c 69 6e 67 20 72 | 6f 75 74 69 6e 65 73 20 |ndling r|outines |
|00000e70| 62 79 20 74 68 65 20 63 | 61 6c 6c 65 72 2c 20 61 |by the c|aller, a|
|00000e80| 6c 74 68 6f 75 67 68 0a | 74 68 65 20 63 61 6c 6c |lthough.|the call|
|00000e90| 65 72 20 6d 75 73 74 20 | 74 61 6b 65 20 61 70 70 |er must |take app|
|00000ea0| 72 6f 70 72 69 61 74 65 | 20 61 63 74 69 6f 6e 20 |ropriate| action |
|00000eb0| 69 6e 20 63 61 73 65 20 | 6f 66 20 66 61 69 6c 75 |in case |of failu|
|00000ec0| 72 65 2e 0a 0a 45 78 61 | 63 74 20 74 79 70 65 20 |re...Exa|ct type |
|00000ed0| 6f 66 20 61 6e 20 69 6d | 61 67 65 20 63 61 6e 20 |of an im|age can |
|00000ee0| 62 65 20 63 68 65 63 6b | 65 64 20 75 73 69 6e 67 |be check|ed using|
|00000ef0| 20 74 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 0a 6d | the fol|lowing.m|
|00000f00| 61 63 72 6f 73 3a 0a 5c | 62 65 67 69 6e 7b 76 65 |acros:.\|begin{ve|
|00000f10| 72 62 61 74 69 6d 7d 0a | 20 49 53 5f 52 47 42 41 |rbatim}.| IS_RGBA|
|00000f20| 28 69 6d 29 20 20 20 20 | 20 20 20 20 20 2f 2a 20 |(im) | /* |
|00000f30| 63 68 65 63 6b 73 20 69 | 66 20 69 6d 61 67 65 20 |checks i|f image |
|00000f40| 69 6d 20 69 73 20 69 6e | 20 63 6f 6c 6f 72 2c 70 |im is in| color,p|
|00000f50| 61 63 6b 65 64 20 70 69 | 78 65 6c 20 2a 2f 0a 20 |acked pi|xel */. |
|00000f60| 49 53 5f 4d 47 52 41 59 | 28 69 6d 29 20 20 20 20 |IS_MGRAY|(im) |
|00000f70| 20 20 20 20 2f 2a 20 63 | 68 65 63 6b 73 20 69 66 | /* c|hecks if|
|00000f80| 20 69 6d 61 67 65 20 69 | 6d 20 69 73 20 67 72 61 | image i|m is gra|
|00000f90| 79 20 69 6e 20 43 49 20 | 20 20 20 20 20 2a 2f 0a |y in CI | */.|
|00000fa0| 20 49 53 5f 42 57 28 69 | 6d 29 20 20 20 20 20 20 | IS_BW(i|m) |
|00000fb0| 20 20 20 20 20 2f 2a 20 | 63 68 65 63 6b 73 20 69 | /* |checks i|
|00000fc0| 66 20 69 6d 61 67 65 20 | 69 6d 20 69 73 20 62 6c |f image |im is bl|
|00000fd0| 61 63 6b 20 26 20 77 68 | 69 74 65 20 20 20 2a 2f |ack & wh|ite */|
|00000fe0| 0a 20 49 53 5f 43 49 28 | 69 6d 29 20 20 20 20 20 |. IS_CI(|im) |
|00000ff0| 20 20 20 20 20 20 2f 2a | 20 63 68 65 63 6b 73 20 | /*| checks |
|00001000| 69 66 20 69 6d 61 67 65 | 20 69 6d 20 69 73 20 69 |if image| im is i|
|00001010| 6e 20 43 49 20 20 20 20 | 20 20 20 20 20 20 20 2a |n CI | *|
|00001020| 2f 0a 20 49 53 5f 52 47 | 42 47 52 41 59 28 69 6d |/. IS_RG|BGRAY(im|
|00001030| 29 20 20 20 20 20 20 2f | 2a 20 63 68 65 63 6b 73 |) /|* checks|
|00001040| 20 69 66 20 69 6d 61 67 | 65 20 69 6d 20 69 73 20 | if imag|e im is |
|00001050| 67 72 61 79 20 69 6e 20 | 70 61 63 6b 65 64 20 20 |gray in |packed |
|00001060| 2a 2f 0a 20 49 53 5f 43 | 50 41 43 4b 28 69 6d 29 |*/. IS_C|PACK(im)|
|00001070| 20 20 20 20 20 20 20 20 | 2f 2a 20 63 68 65 63 6b | |/* check|
|00001080| 73 20 69 66 20 69 6d 61 | 67 65 20 69 6d 20 69 73 |s if ima|ge im is|
|00001090| 20 69 6e 20 70 61 63 6b | 65 64 20 70 69 78 65 6c | in pack|ed pixel|
|000010a0| 20 2a 2f 0a 20 49 53 5f | 47 52 41 59 28 69 6d 29 | */. IS_|GRAY(im)|
|000010b0| 20 20 20 20 20 20 20 20 | 20 2f 2a 20 63 68 65 63 | | /* chec|
|000010c0| 6b 73 20 69 66 20 69 6d | 61 67 65 20 69 6d 20 69 |ks if im|age im i|
|000010d0| 73 20 69 6e 20 70 61 63 | 6b 65 64 20 70 69 78 65 |s in pac|ked pixe|
|000010e0| 6c 20 2a 2f 0a 5c 65 6e | 64 7b 76 65 72 62 61 74 |l */.\en|d{verbat|
|000010f0| 69 6d 7d 0a 0a 5c 73 75 | 62 73 65 63 74 69 6f 6e |im}..\su|bsection|
|00001100| 7b 49 6d 61 67 65 20 53 | 74 72 75 63 74 75 72 65 |{Image S|tructure|
|00001110| 7d 0a 5c 73 75 62 73 65 | 63 74 69 6f 6e 7b 4d 65 |}.\subse|ction{Me|
|00001120| 6d 6f 72 79 20 52 6f 75 | 74 69 6e 65 73 7d 0a 5c |mory Rou|tines}.\|
|00001130| 73 75 62 73 75 62 73 65 | 63 74 69 6f 6e 7b 54 68 |subsubse|ction{Th|
|00001140| 65 20 52 61 73 74 65 72 | 20 6d 61 74 72 69 78 7d |e Raster| matrix}|
|00001150| 0a 74 68 65 20 72 61 73 | 74 65 72 20 6d 61 74 72 |.the ras|ter matr|
|00001160| 69 78 20 69 73 20 61 20 | 74 72 75 65 20 32 2d 44 |ix is a |true 2-D|
|00001170| 20 6d 61 74 72 69 78 2e | 0a 5c 73 75 62 73 65 63 | matrix.|.\subsec|
|00001180| 74 69 6f 6e 7b 45 72 72 | 6f 72 20 48 61 6e 64 6c |tion{Err|or Handl|
|00001190| 69 6e 67 7d 0a 5c 73 75 | 62 73 75 62 73 65 63 74 |ing}.\su|bsubsect|
|000011a0| 69 6f 6e 7b 69 6e 66 6f | 72 6d 61 74 69 6f 6e 61 |ion{info|rmationa|
|000011b0| 6c 20 6d 65 73 73 61 67 | 65 73 7d 0a 5c 73 75 62 |l messag|es}.\sub|
|000011c0| 73 75 62 73 65 63 74 69 | 6f 6e 7b 45 72 72 6f 72 |subsecti|on{Error|
|000011d0| 20 6d 65 73 73 61 67 65 | 73 7d 0a 5c 73 75 62 73 | message|s}.\subs|
|000011e0| 65 63 74 69 6f 6e 7b 41 | 64 64 69 6e 67 20 6e 65 |ection{A|dding ne|
|000011f0| 77 20 66 6f 72 6d 61 74 | 7d 0a 5c 73 75 62 73 75 |w format|}.\subsu|
|00001200| 62 73 65 63 74 69 6f 6e | 7b 4c 6f 61 64 69 6e 67 |bsection|{Loading|
|00001210| 7d 0a 4f 6e 6c 79 20 74 | 77 6f 20 72 6f 75 74 69 |}.Only t|wo routi|
|00001220| 6e 65 73 20 61 72 65 20 | 6e 65 65 64 65 64 20 66 |nes are |needed f|
|00001230| 6f 72 20 61 64 64 69 6e | 67 20 61 20 6e 65 77 20 |or addin|g a new |
|00001240| 66 6f 72 6d 61 74 3a 0a | 5c 62 65 67 69 6e 7b 76 |format:.|\begin{v|
|00001250| 65 72 62 61 74 69 6d 7d | 0a 69 6e 74 20 58 58 58 |erbatim}|.int XXX|
|00001260| 5f 64 65 73 63 28 49 50 | 54 52 20 69 6d 29 3b 0a |_desc(IP|TR im);.|
|00001270| 69 6e 74 20 58 58 58 5f | 6c 6f 61 64 28 49 50 54 |int XXX_|load(IPT|
|00001280| 52 20 69 6d 29 3b 0a 5c | 65 6e 64 7b 76 65 72 62 |R im);.\|end{verb|
|00001290| 61 74 69 6d 7d 0a 0a 74 | 68 65 20 64 65 73 63 72 |atim}..t|he descr|
|000012a0| 69 70 74 69 6f 6e 20 72 | 6f 75 74 69 6e 65 20 73 |iption r|outine s|
|000012b0| 68 6f 75 6c 64 20 72 65 | 61 64 20 28 6f 72 20 61 |hould re|ad (or a|
|000012c0| 70 70 65 61 72 73 20 74 | 6f 20 72 65 61 64 29 20 |ppears t|o read) |
|000012d0| 66 72 6f 6d 20 74 68 65 | 20 0a 73 74 72 65 61 6d |from the| .stream|
|000012e0| 20 5c 76 65 72 62 2b 69 | 6d 2d 3e 66 70 2b 20 61 | \verb+i|m->fp+ a|
|000012f0| 6e 64 20 66 69 6c 6c 20 | 74 68 72 65 65 20 66 69 |nd fill |three fi|
|00001300| 65 6c 64 73 20 69 6e 20 | 74 68 65 20 69 6d 61 67 |elds in |the imag|
|00001310| 65 20 73 74 72 75 63 74 | 75 72 65 2c 0a 69 2e 65 |e struct|ure,.i.e|
|00001320| 2e 2c 20 74 68 65 20 69 | 6d 61 67 65 20 77 69 64 |., the i|mage wid|
|00001330| 74 68 2c 20 68 65 69 67 | 68 74 20 61 6e 64 20 69 |th, heig|ht and i|
|00001340| 6d 61 67 65 20 74 79 70 | 65 20 0a 5c 76 65 72 62 |mage typ|e .\verb|
|00001350| 2b 69 6d 2d 3e 77 2c 20 | 69 6d 2d 3e 68 2c 20 69 |+im->w, |im->h, i|
|00001360| 6d 2d 3e 74 79 70 65 2b | 0a 0a 54 68 65 20 6c 6f |m->type+|..The lo|
|00001370| 61 64 20 72 6f 75 74 69 | 6e 65 20 73 68 6f 75 6c |ad routi|ne shoul|
|00001380| 64 20 66 69 6c 6c 20 74 | 68 65 20 72 61 73 74 65 |d fill t|he raste|
|00001390| 72 20 6d 61 74 72 69 78 | 2e 0a 0a 49 6e 20 6e 6f |r matrix|...In no|
|000013a0| 20 63 61 73 65 20 73 68 | 6f 75 6c 64 20 74 68 65 | case sh|ould the|
|000013b0| 20 72 65 61 64 69 6e 67 | 20 72 6f 75 74 69 6e 65 | reading| routine|
|000013c0| 20 63 6c 6f 73 65 20 74 | 68 65 20 73 74 72 65 61 | close t|he strea|
|000013d0| 6d 20 70 6f 69 6e 74 65 | 64 0a 74 6f 20 62 79 20 |m pointe|d.to by |
|000013e0| 5c 76 65 72 62 2b 69 6d | 2d 3e 66 70 2b 2e 0a 0a |\verb+im|->fp+...|
|000013f0| 5c 73 75 62 73 75 62 73 | 65 63 74 69 6f 6e 7b 57 |\subsubs|ection{W|
|00001400| 72 69 74 69 6e 67 7d 0a | 5c 73 75 62 73 75 62 73 |riting}.|\subsubs|
|00001410| 65 63 74 69 6f 6e 7b 50 | 72 6f 67 72 65 73 73 20 |ection{P|rogress |
|00001420| 52 65 70 6f 72 74 7d 0a | 5c 73 75 62 73 75 62 73 |Report}.|\subsubs|
|00001430| 65 63 74 69 6f 6e 7b 4d | 6f 72 65 20 52 65 6d 61 |ection{M|ore Rema|
|00001440| 72 6b 73 7d 0a 5c 73 75 | 62 73 65 63 74 69 6f 6e |rks}.\su|bsection|
|00001450| 7b 41 64 64 69 6e 67 20 | 45 64 69 74 20 43 61 70 |{Adding |Edit Cap|
|00001460| 61 62 69 6c 69 74 69 65 | 73 7d 0a 5c 73 75 62 73 |abilitie|s}.\subs|
|00001470| 75 62 73 65 63 74 69 6f | 6e 7b 52 75 62 62 65 72 |ubsectio|n{Rubber|
|00001480| 20 42 61 6e 64 73 7d 0a | 5c 73 75 62 73 75 62 73 | Bands}.|\subsubs|
|00001490| 65 63 74 69 6f 6e 7b 53 | 75 62 2d 69 6d 61 67 65 |ection{S|ub-image|
|000014a0| 73 7d 0a | |s}. | |
+--------+-------------------------+-------------------------+--------+--------+